<?php
/**
 * Created by PhpStorm.
 * User: xuho
 * Date: 2020-02-15
 * Time: 19:37
 */

namespace app\cdc\validate\admin;


class RuleValidate extends \app\common\validate\BaseValidate
{
    protected $rule = [
        'parent_id' => 'require',
        'name' => 'require',
        'is_menu' => 'require',
        'status' => 'require|in:0,1',
        'rule_ids' => 'require',
    ];

    protected $message = [
        'parent_id.require' => '请选择 父级',
        'name.require' => '请输入 权限名称',
        'is_menu.require' => '请选择 是否菜单',
        'status.require' => '状态 必填',
        'status.in' => '状态 错误',
        'rule_ids.require' => '请更换 权限规则',
    ];

    protected $scene = [
        'save' => ['parent_id', 'name', 'is_menu', 'status'],
        'update' => ['parent_id', 'name', 'is_menu', 'status'],
        'resort' => ['rule_ids'],
    ];
}